package cn.itcast.classSM.dao;

import java.util.Date;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.classSM.domain.CheckMessage;
import cn.itcast.classSM.domain.Clazz;
import cn.itcast.classSM.domain.MainCheckMessage;

public interface AdministratorRepository extends JpaRepository<Clazz, Integer>{
	@Query("from CheckMessage cm where cm.checkTime >= ?1 and cm.checkTime<=?2")
	List<CheckMessage> findMonth(Date startdate,Date enddate);
    @Query()
    @Modifying
	List<MainCheckMessage> findClazzMonth(Date date, Integer cid);
    @Query("update Clazz set cState = 3 where cid=? ")
    @Modifying
	public void update(Integer cid);

}
